/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package tv.global.web;

import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.SessionScoped;
import tv.global.modelo.ItemVideo;
import tv.global.rn.VideosRN;

/**
 *
 * @author ctrosch
 */
@ManagedBean
@SessionScoped
public class VideosBean {

    @EJB private VideosRN VideosRN;

    @ManagedProperty(value = "#{aplicacionBean}")
    private AplicacionBean aplicacionBean;
    private int orden;

    private ItemVideo itemVideo;

    /** Creates a new instance of BannerBean */
    public VideosBean() {
        
    }

    @PostConstruct
    private void init() {
        
    }

    public void cargarVideo(){

        if(orden > 0){

            itemVideo = VideosRN.getVideo(orden);

        }
    }

    public ItemVideo getItemVideo() {
        return itemVideo;
    }

    public void setItemVideo(ItemVideo itemVideo) {
        this.itemVideo = itemVideo;
    }

    public AplicacionBean getAplicacionBean() {
        return aplicacionBean;
    }

    public void setAplicacionBean(AplicacionBean aplicacionBean) {
        this.aplicacionBean = aplicacionBean;
    }
    public void seleccionarVideo(ItemVideo v){

        itemVideo = v;
    }

    public int getOrden() {
        return orden;
    }

    public void setOrden(int orden) {
        this.orden = orden;
    }

}
